package com.mao;

import redis.clients.jedis.Jedis;
import redis.clients.jedis.Response;
import redis.clients.jedis.Transaction;

/**
 * Author: Administrator
 * Date: 2021/5/18 22:11
 * Description: 测试乐观锁
 */
public class TestTX2 {
    public static void main(String[] args) {
        //连接redis
        Jedis jedis = new Jedis("127.0.0.1", 6379);

        Transaction multi = jedis.multi();
        multi.set("money","2000");// 直接设置money为2000
        multi.exec();
    }
}
